---
title: Dagster with Airflow | Dagster
---

# Using Dagster with Airflow

<CodeReferenceLink filePath="examples/airflow_ingest" />

The [`dagster-airflow`](/\_apidocs/libraries/dagster_airflow) package allows users to run Dagster pipelines on Airflow clusters, and to import Airflow DAGs into Dagster instances.

This is not recommended for new projects. This is designed for users who want to use the Dagster API within an existing Airflow cluster, and for those who want tooling support to migrate away from Airflow. Using Dagster within an Airflow limits its capabilities, as you still have to rely on Airflow's scheduler, and not all Dagster features (e.g. manual retries from Dagit) will work.

## Airflow Ingest

This example demonstrates how to use <PyObject   module="dagster_airflow"   object="make_dagster_pipeline_from_airflow_dag" /> to compile an Airflow DAG into a Dagster pipeline that can be executed (and explored) the same way as a Dagster-native pipeline.

There are two pipelines in the repo:

- `airflow_simple_dag` demonstrates the use of Airflow templates.
- `airflow_complex_dag` shows the translation of a more complex dependency structure.

```python file=../../airflow_ingest/repo.py startafter=start_repo_marker_0 endbefore=end_repo_marker_0
from airflow_ingest.airflow_complex_dag import complex_dag
from airflow_ingest.airflow_simple_dag import simple_dag
from dagster import repository
from dagster_airflow.dagster_pipeline_factory import make_dagster_pipeline_from_airflow_dag

airflow_simple_dag = make_dagster_pipeline_from_airflow_dag(simple_dag)
airflow_complex_dag = make_dagster_pipeline_from_airflow_dag(complex_dag)


@repository
def airflow_ingest_example():
    return [airflow_complex_dag, airflow_simple_dag]
```

Note that the "execution_date" for the Airflow DAG is specified through the pipeline tags. To specify tags, call to:

```python
make_dagster_pipeline_from_airflow_dag(
    dag=dag,
    tags={'airflow_execution_date': utc_execution_date_str}
)
```
